import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MaterialCharaTempVO, MaterialCharaTempForm, MaterialCharaTempQuery } from '@/api/manu/materialCharaTemp/types';

/**
 * 查询物料特征模板列表
 * @param query
 * @returns {*}
 */

export const listMaterialCharaTemp = (query?: MaterialCharaTempQuery): AxiosPromise<MaterialCharaTempVO[]> => {
  return request({
    url: '/manu/materialCharaTemp/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询物料特征模板详细
 * @param id
 */
export const getMaterialCharaTemp = (id: string | number): AxiosPromise<MaterialCharaTempVO> => {
  return request({
    url: '/manu/materialCharaTemp/' + id,
    method: 'get'
  });
};

/**
 * 新增物料特征模板
 * @param data
 */
export const addMaterialCharaTemp = (data: MaterialCharaTempForm) => {
  return request({
    url: '/manu/materialCharaTemp',
    method: 'post',
    data: data
  });
};

/**
 * 修改物料特征模板
 * @param data
 */
export const updateMaterialCharaTemp = (data: MaterialCharaTempForm) => {
  return request({
    url: '/manu/materialCharaTemp',
    method: 'put',
    data: data
  });
};

/**
 * 删除物料特征模板
 * @param id
 */
export const delMaterialCharaTemp = (id: string | number | Array<string | number>) => {
  return request({
    url: '/manu/materialCharaTemp/' + id,
    method: 'delete'
  });
};
